#include <stdio.h>

int main()
{
    int n,x,i,a[99];
    int a0,a1,a2,a3,a4,a5,a6,a7,a8,a9;
    a0=a1=a2=a3=a4=a5=a6=a7=a8=a9=0;
    scanf("%d %d",n,x);
    for(i=1;i<=n;i++)
        a[i]=i;
    for(i=1;i<=n;i++)
        printf("%d ",&a[i]);
    
    for(i=1;i<=n;i++)
        {
            switch (a[i])
            {
            case 0:
                a0++;
                break;
            
            case 1:
                a1++;
                break;

            case 2:
                a2++;
                break;

            case 3:
                a1++;
                break;
            case 4:
                a1++;
                break;

            case 5:
                a5++;
                break;

            case 6:
                a6++;
                break;
            
            case 7:
                a7++;
                break;

            case 8:
                a8++;
                break;

            case 9:
                a9++;
                break;
            }
        }
    
    if(x==0)
        printf("%d",a0);
    else if(x==1)
        printf("%d",a1);
    else if(x==2)
        printf("%d",a2);
    else if(x==3)
        printf("%d",a3);
    else if(x==4)
        printf("%d",a4);
    else if(x==5)
        printf("%d",a5);
    else if(x==6)
        printf("%d",a6);
    else if(x==7)
        printf("%d",a7);
    else if(x==8)
        printf("%d",a8);
    else if(x==9)
        printf("%d",a9);
}